package com.zn.task;

import com.zn.service.AppBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 金十定时任务
 * @author chenwenjing
 * @time 2019/3/13 15:57
 */
@Component
public class JinShiTask {

    @Autowired
    private AppBannerService appBannerService;

    /**
     * 定时每天05：00：00清除5天前的所有金十数据
     * @author chenwenjing
     * @time 2019/3/13 15:57
     * @param
     */
    @Scheduled(cron="0 00 05 * * ?")
    public void delectJinShiData() throws Exception{
        int count = appBannerService.findDay();
        if (count != 0){
            appBannerService.delectJinShiData();
        }
    }
}
